<?php
require_once("taskView.php");
require_once(CORE_DIR.'taskModel.php');

class changeorderAction extends authAction{

	function __construct(){
		$this->view = new taskView();
	}

	public function run($get, $post, $viewtype) {
		parent::run($get,$post,$viewtype);
		
		$tModel = new taskModel();		
		
		if (isset($get["id"]) && isset($get["taskidlist"])) {
			$orderList = explode("|", $get["taskidlist"]);
			
			$tModel->updateTaskListOrder($orderList);
			
			$this->view->setProperty("status", 1);
			$this->view->setProperty("id", $get["id"]);
			$this->view->showChangeTaskOrder();
		}
		else{
			$this->view->showBadCmd();
		}	
			
	}
}
?>